package com.luu.game.dao.impl;

import com.luu.game.dao.SkillDao;
import com.luu.game.data.dto.SkillInfoDTO;
import com.luu.game.data.entity.SkillsEntity;
import com.luu.game.mapper.SkillMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SkillDaoImpl implements SkillDao {

    @Autowired
    private SkillMapper skillMapper;

    @Override
    public SkillInfoDTO findById(Integer id) {
        final SkillsEntity skillsEntity = skillMapper.selectById(id);
        SkillInfoDTO returnDTO = new SkillInfoDTO();
        BeanUtils.copyProperties(skillsEntity,returnDTO);
        return returnDTO;
    }
}
